<?php
require('../../lib/base.php');
$base=new base(array('web'));
$get=$base->get(array('action'=>true,'track'=>true,'pt'=>false,'url'=>false));
$visitor=$base->cookie('visitor',true);
$base->model('data')->insert('track',array('action'=>$get['action'],'visitor'=>$visitor,'track'=>$get['track'],'pageview'=>intval($get['pt']),'date'=>$base->server('REQUEST_TIME')));
if(isset($get['url'])){
	$url=urldecode($get['url']);
	$url.=stripos($url,'?')===false?'?':'&';
	header('Location: '.$url.'track='.$visitor.$get['track'].$get['pt']);
}
header('Cache-Control:public,max-age=2592000');
header('Pragma:public,max-age=2592000');
header('Expires: Mon, 26 Jul 2086 05:00:00 GMT');
header('Content-Type:text/javascript');
?>